Because of a change in the order of operations in the computation of risk factor derivatives (the deltas) for aggregations, floating point arithmetic produces slightly different values of related output variables in SAS Risk Dimensions 4.2 (and 4.2.1) and in SAS Risk Dimensions 5.2/5.3. This affects only the Sensitivity and Delta Normal analyses.
In SAS Risk Dimensions 5.3_M1 and beyond, the calculation of the aggregate derivatives is the same the same as it is in SAS Risk Dimensions 4.2.
In version 4.2, the derivative is calculated for each position, and then those derivatives are summed to compute the derivative of n positions in a sub-portfolio.
In versions 5.2 and 5.3, the approach for the calculation is altered. For each position, the values are calculated at r+h and r-h, where r is the basecase value of a single risk factor and h is the finite-difference step. Those values are summed across n positions in a sub-portfolio, and then the derivative is calculated using the summed values.
Consider the center-difference approximation for the first derivative of the value, V, with respect to a single risk factor at the base case:
In SAS Risk Dimensions 4.2, an aggregate derivative of this risk factor is approximated by:
In SAS Risk Dimensions 5.2 and 5.3, an aggregate derivative of this risk factor is approximated by:
In both cases, j=1 to n reflects the number of positions that are rolled up into the aggregation.
Algebraically, the two computations are equivalent. However, floating point arithmetic often evaluates them to different values. The number of positions being summed and the relative magnitude of the derivatives can exaggerate the differences between these methods and introduce small differences in VaR.
As an example, consider the code listed on the Full Code tab. When this extreme case was run in SAS Risk Dimensions 4.2.1 and SAS Risk Dimensions 5.2_M1 (both installed on the same machine), relative percentage differences of 9.056E-11 and 9.055E-11 were noticed for the output variables rf1 and VaR, respectively, at the top (+,+) sub-portfolio.
Note that results might vary. As is always the case, different factors affect numeric precision. For more information, see SAS Note 31560.
Product Family | Product | System | Product Release | SAS Release | ||
Reported | Fixed* | Reported | Fixed* | |||
SAS System | SAS Risk Dimensions Enterprise Edition | Microsoft® Windows® for x64 | 5.2 | 5.3_M1 | 9.2 TS2M0 | |
Microsoft Windows 95/98 | 5.2 | |||||
Microsoft Windows 2000 Advanced Server | 5.2 | |||||
Microsoft Windows 2000 Datacenter Server | 5.2 | |||||
Microsoft Windows 2000 Server | 5.2 | |||||
Microsoft Windows 2000 Professional | 5.2 | |||||
Microsoft Windows NT Workstation | 5.2 | |||||
Microsoft Windows Server 2003 Datacenter Edition | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Microsoft Windows Server 2003 Standard Edition | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Microsoft Windows Server 2003 for x64 | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Microsoft Windows Server 2008 | 5.2 | |||||
Microsoft Windows Server 2008 for x64 | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Microsoft Windows XP Professional | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Windows 7 Enterprise 32 bit | 5.2 | |||||
Windows 7 Enterprise x64 | 5.2 | |||||
Windows 7 Home Premium 32 bit | 5.2 | |||||
Windows 7 Home Premium x64 | 5.2 | |||||
Windows 7 Professional 32 bit | 5.2 | |||||
Windows 7 Professional x64 | 5.2 | |||||
Windows 7 Ultimate 32 bit | 5.2 | |||||
Windows 7 Ultimate x64 | 5.2 | |||||
Windows Millennium Edition (Me) | 5.2 | |||||
Windows Vista | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Windows Vista for x64 | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
64-bit Enabled AIX | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
64-bit Enabled HP-UX | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
64-bit Enabled Solaris | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
HP-UX IPF | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Linux | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Linux for x64 | 5.2 | 5.3_M1 | 9.2 TS2M0 | |||
Solaris for x64 | 5.2 | 5.3_M1 | 9.2 TS2M0 |
libname fourtwo '';
libname fivetwo '';
%let test_lib1 = fourtwo; /*change based on SAS Risk Dimensions version*/
%let test_env = risk;
%let ccvars = insttype instid;
proc risk;
env new=&test_lib1..&test_env;
declare riskfactors=(rf1 num var);
env save;
run;
proc compile env=&test_lib1..&test_env outlib=&test_lib1..&test_env;
method Price2 kind=price;
a = 300000003003.0303033;
_value_ = a*rf1;
endmethod;
run;
proc compile env=&test_lib1..&test_env outlib=&test_lib1..&test_env;
method Price3 kind=price;
b = 1001001.0101011;
_value_ = b*rf1;
endmethod;
run;
data &test_lib1..instdata;
input insttype $ instid $;
datalines;
Inst1 i1
Inst1 i2
Inst1 i3
Inst1 i4
Inst2 i5
Inst2 i6
Inst2 i7
Inst2 i8
run;
data &test_lib1..mktdata;
rf1=1;
run;
data &test_lib1..covdata;
length _name_ _type_ $8;
_type_ = "COV";
input _name_ $ rf1;
datalines;
rf1 .1
run;
proc risk;
env open=&test_lib1..&test_env;
marketdata Market file=&test_lib1..mktdata type=current;
marketdata Cov file=&test_lib1..covdata type=covariance interval=day;
deltanormal Deltanormal data=Cov;
instrument Inst1 methods=(Price Price2);
instrument Inst2 methods=(Price Price3);
instdata Port file=&test_lib1..instdata format=simple;
sources Source (Port);
read sources=Source out=Read;
crossclass cc (&ccvars);
project Project
crossclass = cc
analysis=(DeltaNormal)
portfolio=Read
out=Project
data=(Market)
options=(outall);
runproject Project
outlib=&test_lib1;
env save;
run;
Type: | Problem Note |
Priority: | high |
Date Modified: | 2011-02-25 14:21:46 |
Date Created: | 2011-02-11 13:22:58 |